#ifndef TCP_RECEIVE_THREAD_H
#define TCP_RECEIVE_THREAD_H

#include "memberCenter.h"
#include "groupCenter.h"
#include "myThread.h"

class TCPRecvThread : public MyThread
{
public:
	TCPRecvThread();
	TCPRecvThread(singleMember *single_member, 
		groupCenter *group_center, memberCenter *member_center);

	void init(singleMember *single_member, 
		groupCenter *group_center, memberCenter *member_center);

private:
	UINT WINAPI threadWork();

	void handleMessageKeyPubH(char *str_message);
	void handleMessageKeyPubO(char *str_message);
	void handleMessageKeyPubR(char *str_message);
	void handleMessageKeyPubA(char *str_message);
	void handleMessageOffLine(char *str_message);
	void handleMessageCiphertext(char *str_message);
	void handleMessageMemberList(char *str_message);
	void handleMessageGroupInvit(char *str_message);
	void handleMessagLeaveGroup(char *str_message);
	void handleMessageJoinGroup(char *str_message);
	void handleMessageMemberAdd(char *str_message);
	void handleMessageKickOut(char *str_message);
	void handleDummy(char *str_message);

private:
	singleMember *m_single_member;
	groupCenter  *m_group_center;
	memberCenter *m_member_center;
};

#endif